﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace Restaurant
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            //url route for webservice requests with an optional date parameter
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{date}",
                defaults: new { date = RouteParameter.Optional }
            );

            //url route for webservice request to get reservations between dates - not used in final version
            //config.Routes.MapHttpRoute(
            //    name: "ApiPeriod",
            //    routeTemplate: "api/{controller}/{startDate}/{endDate}",
            //    defaults: new { startDate = RouteParameter.Optional, endDate = RouteParameter.Optional }
            //);
        }
    }
}
